def add_ellipsis(comments, max_length=10):
    return [
        comment[:max_length] + "..." if len(comment) > max_length else comment
        for comment in comments]


def add_ellipsis_map(comments, max_length=10):
    func = lambda comment: comment[:max_length] + '...' \
        if len(comment) > max_length else comment
    return list(map(func, comments))


def add_ellipsis_generator(comments, max_length=10):
    for comment in comments:
        if len(comment) > max_length:
            comment = comment[:max_length] + '...'

        yield comment
# 完成的不错。可以思考下有什么不同
